:: -----------------------------------------------------------------------
:: Script for build P2RC.CRM resource file
::
:: Version information:
:: $Id: build.bat,v 1 2010/01/17 16:02:43 Exp $
:: -----------------------------------------------------------------------
@echo off
setlocal

set BR_CURR_PATH=%~dp0
set OUT_FILE="%BR_CURR_PATH%\..\crm.res"
set OUT_DB_FILE="%BR_CURR_PATH%\..\crm_db.res"

@echo.
@echo Start to compile crm.res..

pushd "%BR_CURR_PATH%"

if exist %OUT_FILE% del %OUT_FILE%
if exist %OUT_DB_FILE% del %OUT_DB_FILE%

brcc32.exe -fo%OUT_FILE% crm.rc || goto end
brcc32.exe -fo%OUT_DB_FILE% crm_db.rc || goto end

popd


:end
if "%errorlevel%" neq "0" (
    @echo.
    @echo ERROR!
    @echo Compilation failed, see log for details
    pause
) else (
    @echo Ok.
)

endlocal
exit /b %errorlevel%
